package com.honghu.villagepost.adapter

import android.widget.TextView
import com.honghu.villagepost.R
import com.honghu.villagepost.entity.Store
import com.blankj.utilcode.util.PhoneUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder

/**
 * @author: mqwang
 * @create: 2/24/21 4:06 PM
 * @Description:
 */
class NearSiteAdapter : BaseQuickAdapter<Store, BaseViewHolder>(R.layout.adapter_near_site) {

    override fun convert(helper: BaseViewHolder?, item: Store?) {
        helper!!.setText(R.id.tv_title, item!!.name)
        helper!!.setText(R.id.tv_addr, item!!.address)
        helper!!.setText(R.id.tv_phone, item!!.principalMobile)
        helper.getView<TextView>(R.id.tv_phone).setOnClickListener {
            PhoneUtils.dial(item!!.principalMobile)
        }
    }

}